home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / s-pooemp.ads < prev    next >
Text File  |  1996-01-30  |  3KB  |  72 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT COMPILER COMPONENTS                         --
  4. --                                                                          --
  5. --                    S Y S T E M . P O O L _ E M P T Y                     --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.4 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- The GNAT library is free software; you can redistribute it and/or modify --
  14. -- it under terms of the GNU Library General Public License as published by --
  15. -- the Free Software  Foundation; either version 2, or (at your option) any --
  16. -- later version.  The GNAT library is distributed in the hope that it will --
  17. -- be useful, but WITHOUT ANY WARRANTY;  without even  the implied warranty --
  18. -- of MERCHANTABILITY  or  FITNESS FOR  A PARTICULAR PURPOSE.  See the  GNU --
  19. -- Library  General  Public  License for  more  details.  You  should  have --
  20. -- received  a copy of the GNU  Library  General Public License  along with --
  21. -- the GNAT library;  see the file  COPYING.LIB.  If not, write to the Free --
  22. -- Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.        --
  23. --                                                                          --
  24. ------------------------------------------------------------------------------
  25.  
  26. with System.Storage_Pools;
  27. with System.Storage_Elements;
  28.  
  29. package System.Pool_Empty is
  30.  
  31. pragma Elaborate_Body;
  32. --  Needed to ensure that library routines can execute allocators
  33.  
  34.    ----------------
  35.    -- Empty_Pool --
  36.    ----------------
  37.  
  38.    --  Allocation strategy:
  39.  
  40.    --    Raise storage Error on Allocate
  41.  
  42.    --  Used in the compiler for access types with 'STORAGE_SIZE = 0
  43.    --  Avoid any overhead for Init/Finalize
  44.  
  45.    type Empty_Pool is new
  46.      System.Storage_Pools.Root_Storage_Pool with null record;
  47.  
  48.    function Storage_Size
  49.      (Pool : Empty_Pool)
  50.       return System.Storage_Elements.Storage_Count;
  51.  
  52.    procedure Allocate
  53.      (Pool         : in out Empty_Pool;
  54.       Address      : out System.Address;
  55.       Storage_Size : System.Storage_Elements.Storage_Count;
  56.       Alignment    : System.Storage_Elements.Storage_Count);
  57.  
  58.    procedure Deallocate
  59.      (Pool         : in out Empty_Pool;
  60.       Address      : System.Address;
  61.       Storage_Size : System.Storage_Elements.Storage_Count;
  62.       Alignment    : System.Storage_Elements.Storage_Count);
  63.  
  64.    procedure Initialize (Pool : in out Empty_Pool);
  65.    procedure Finalize   (Pool : in out Empty_Pool);
  66.  
  67.    --  The only actual instance of this type
  68.  
  69.    Empty_Pool_Object : Empty_Pool;
  70.  
  71. end System.Pool_Empty;
  72.